/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui.gui.documents.actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

import ui.gui.actions.OpenFileAction;
import ui.gui.documents.AbstractDocument;
import ui.gui.documents.AltaricaCodeEditor;
import ui.gui.documents.EditorAction;

/**
 *
 * @author stephane
 */
public class ActionPaste extends EditorAction
{
    private static final long serialVersionUID = 1L;
   public ActionPaste(AbstractDocument document)
   {
       super("Paste", document);
       putValue(AbstractAction.SMALL_ICON, new javax.swing.ImageIcon(OpenFileAction.class.getResource("/resources/paste.png")));
       putValue(AbstractAction.SHORT_DESCRIPTION, "Paste");
   }
    @Override
    public void actionPerformed(ActionEvent e) {
        if (getDocument() != null && getDocument() instanceof AltaricaCodeEditor)
        {
            AltaricaCodeEditor editor = (AltaricaCodeEditor)getDocument();
            editor.getEditorObject().paste();
        }
    }
    
}
